package notes.java.sjms23.t12_iterator;

import java.util.ArrayList;
import java.util.List;

// 迭代器模式
public class Client {

    public static void main(String[] args) {
        
        
        List<Object> objs = new ArrayList<>();
        objs.add("语文");
        objs.add("数学");
        objs.add("英语");
        objs.add(15);
        
        MyContainer container = new ObjectContainer(objs);
        
        for(MyIterator iter = container.getIterator(); iter.hasNext();) {
            Object obj = iter.next();
            System.out.println(obj);
        }
        
    }
}
